package com.dmcliver.expensemanager.session;

import com.dmcliver.expensemanager.entity.*;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

@Name("accountuserHome")
public class AccountuserHome extends EntityHome<Accountuser> {

	public void setAccountuserUsername(String id) {
		setId(id);
	}

	public String getAccountuserUsername() {
		return (String) getId();
	}

	@Override
	protected Accountuser createInstance() {
		Accountuser accountuser = new Accountuser();
		return accountuser;
	}

	public void load() {
		if (isIdDefined()) {
			wire();
		}
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public Accountuser getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

	public List<Expense> getExpenses() {
		return getInstance() == null ? null : new ArrayList<Expense>(
				getInstance().getExpenses());
	}

}
